package com.library.weiget;

import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;

/**
 * Created by Administrator on 2016/1/5.
 */
public class SpaceItemDecoration extends RecyclerView.ItemDecoration {

    private int space_left,space_right,space_bottom,space_top;


    public SpaceItemDecoration(int space_left, int space_right, int space_bottom, int space_top) {
        this.space_left = space_left;
        this.space_right = space_right;
        this.space_bottom = space_bottom;
        this.space_top = space_top;
    }

    public SpaceItemDecoration(int space_left) {
        this.space_left = space_left;
    }

    @Override
    public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
        outRect.left = space_left;
        outRect.right=space_right;
        outRect.top=space_top;
        outRect.bottom=space_bottom;
    }
}
